import { createApp } from 'vue'

import { registerApp } from './global'

import App from './App.vue'

import router from '@/router'
import store from './store'

// 导入封装好的axios
import hyRequset from '@/service'

// hyRequset.requst({
//   url: '/home/multidata',
//   method: 'get',
//   interceptors: {
//     requestInterceptor: (config) => {
//       console.log('单独请求的config')
//       return config
//     },
//     responseInterceptor(response) {
//       console.log('单独响应的response')
//       return response
//     }
//   }
// })
interface DataType {
  data: any
  returnCode: string
  success: boolean
}
hyRequset
  .get<DataType>({
    url: '/home/multidata'
  })
  .then((res) => {
    console.log(res.data)
    console.log(res.returnCode)
    console.log(res.success)
  })

const app = createApp(App)
registerApp(app)
app.use(router)
app.use(store)
app.mount('#app')

// console.log(process.env.VUE_APP_BASE_URL)
// console.log(process.env.VUE_APP_BASE_NAME)
